//C20:Listing 20.3 -- throwing.
#include <iostream>
using namespace std;

const int DefaultSize = 10;

int main(void)
{
    int top = 90;
    int bottom = 0;

    try {
      cout << "top / 2 = " << (top / 2) << endl;
      cout << "top divided by bottom = ";
      if (bottom == 0)
      {
        throw "Division by zero!" << endl;
      }
      cout << (top / bottom) << endl;
      cout << "top / 3 = " << (top / 3) << endl;
    } catch (const char* ex) {
      cout << "\n*** " << ex << " ***" << endl;
    }
    cout << "Done." << endl;
}